package org.example.home;

import lombok.experimental.Tolerate;

/**
 * @author TonySong
 * @date 2024/5/6 0006
 * @time 15:31
 */
public class Person {

     public void goHome(){
         System.out.println("步行回家！");
     }


     public void goHome(VelTool vehicle){
         vehicle.run();
     }

     public static VelTool  chose(int m){
         VelTool tool =null;
         switch (m){
             case 1 ->{
                 tool = new Bus();
             }
             case 2 ->{
                 tool =new Car();
             }
             case 3 ->{
                 tool = new Bike();
             }
             case 4 ->{
                 tool = new Plean();
             }
         }
         return tool;
     }

//    public void goHome(Bus bus){
//        bus.run();
//    }
//
//    public void goHome(Car car){
//         car.run();
//    }
//
//    public void goHome(Bike bike){
//        bike.run();
//    }

}
